
BIN=CMY
SRC=$(wildcard *.c) # shell ls *.c
OBJ=$(SRC:.c=.o)
CC=gcc
LOPT=-o
COPT=-c
RM=rm -rf

$(BIN):$(OBJ)
	@echo "正在链接..."
	@$(CC) $(LOPT) $@ $^ 
	@echo "将$(BIN)拷贝到家目录bin中..."
	@cp $(BIN) $(HOME)/bin
%.o:%.c
	@echo "正在翻译..."
	@$(CC) $(COPT) $< 
.PHONEY:clean
clean:
	@echo "正在清理..."
	@$(RM) $(OBJ) $(BIN)
	@echo "将$(BIN)从家目录bin中移除..."
	@$(RM) $(HOME)/bin/$(BIN)
